#pragma once

#include "IAddinManager.h"

class AddinManager : public IAddinManager
{
	typedef std::map<String,IObject*> AddinDictionary;

public:
	BEGIN_DEFINE_CLASS(CLSID_AddinManager)
		DEFINE_INTERFACE_ENTRY(IAddinManager)
	END_DEFINE_CLASS()

	AddinManager();
	virtual ~AddinManager();

	virtual vresult  LoadAll();
	virtual void UnloadAll();

private:
	vresult LoadByCategory(const String& category);
	vresult  Load(const String& path);
	void Unload(const String& path);

private:
	AddinDictionary m_addins;
};

AUTO_REGISTER_CLASSMAP_ENTRY(AddinManager)